package com.atguigu.gmall.product.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author XIN
 * 2023/4/20
 */
@Configuration
public class FileConfig {
	
	@Value("${minio.endpointUrl}")
	private String endpointUrl;
	
	@Value("${minio.accessKey}")
	private String accessKey;
	
	
	@Value("${minio.secreKey}")
	private String secreKey;
	
	@Bean
	public MinioClient minioClient(){
		return MinioClient.builder()
				.endpoint(endpointUrl)
				.credentials(accessKey, secreKey)
				.build();
	}
}
